import coin.exchange.coinone_v2.kr_rest.private_client as privc
import coin.exchange.coinone_v2.kr_rest.product as exchange_product
from coin.exchange.base.kr_rest.order_base import OrderBase


class CoinoneV2Order(OrderBase):
  ProductType = exchange_product.CoinoneProduct

  def __init__(self, products, key_file):
    OrderBase.__init__(self, products, key_file)
    self.client = privc.CoinonePrivateClient(key_file)

  def query_balance_impl(self):
    return self.client.query_account_balance()

  def query_submit(self, product, side, price, qty):
    return self.client.query_submit(product, side, price, qty)

  def query_cancel(self, product, order_id):
    return self.client.query_cancel(product, order_id)

  def query_cancel_product(self, product):
    return self.client.query_cancel_product(product)

  def query_list_orders(self, product):
    return self.client.query_list_orders(product)
